home *** CD-ROM | disk | FTP | other *** search
- #ifndef SETTINGS_H
- #define SETTINGS_H
-
-
- #include "Rules.h"
-
- #ifndef THINK_C
- #include <QuickDraw.h>
- #include <Types.h>
- #endif
-
-
- enum _playerKind
- {
- humanPlayer = 1,
- networkPlayer,
- macPlayer
- };
-
- enum _strategy
- {
- human = -1,
- firstStrategy = 0,
- secondStrategy,
- thirdStrategy,
- fourthStrategy
- };
-
-
- typedef struct
- {
- #define kSettingsVersion 140
- short Version;
- short Players;
- short FieldWidth;
- short FieldHeight;
- Boolean SoundOn;
- Boolean Balls3D;
- short BackgroundPictID;
- Boolean ShowNotation;
- short PlayerKind[kPlayers+1];
- short Strategy[kPlayers+1];
- short Level[kPlayers+1];
- Boolean Connected[kPlayers+1];
- char PlayerName[kPlayers+1][32];
- RGBColor Color[kPlayers+1];
-
- } Settings, *SettingsPtr;
-
-
- void SetPlayerName (SettingsPtr settings, short player, StringPtr name);
- StringPtr GetPlayerName (SettingsPtr settings, short player);
-
- Boolean ConfirmPlayerKind (short player, short type);
- Boolean ConfirmNetQuit (void);
-
- void SetPlayerKind (SettingsPtr settings, short player, short type);
- // Sets the player to a type.
- // Can fail, because the user is asked to confirm
- // the breaking of a network connection.
-
- short GetPlayerKind (SettingsPtr settings, short player);
- // Returns the type of a player.
-
- Boolean IsNetPlayer (SettingsPtr settings, short player);
- Boolean IsMacPlayer (SettingsPtr settings, short player);
- Boolean IsHumanPlayer (SettingsPtr settings, short player);
-
- short CountNetPlayers (SettingsPtr settings);
- short CountMacPlayers (SettingsPtr settings);
- short CountHumanPlayers (SettingsPtr settings);
-
-
- #ifdef SETTINGS_C
-
- #include "Connection.h"
- #include "StringLib.h"
-
- #ifndef THINK_C
- #include <Dialogs.h>
- #include <Strings.h>
- #endif
-
- short CountPlayerKind (SettingsPtr settings, short type);
-
- #else
-
- extern Settings gSet;
-
- #endif
-
-
- #endif